.class public Lorg/microemu/android/device/AndroidMutableImage;
.super Lorg/microemu/device/MutableImage;
.source "AndroidMutableImage.java"


# instance fields
.field private bitmap:Landroid/graphics/Bitmap;


# direct methods
.method public constructor <init>(II)V
    .locals 1
    .parameter "width"
    .parameter "height"

    .prologue
    .line 40
    invoke-direct {p0}, Lorg/microemu/device/MutableImage;-><init>()V

    .line 41
    sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {p1, p2, v0}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lorg/microemu/android/device/AndroidMutableImage;->bitmap:Landroid/graphics/Bitmap;

    .line 42
    return-void
.end method


# virtual methods
.method public getBitmap()Landroid/graphics/Bitmap;
    .locals 1

    .prologue
    .line 67
    iget-object v0, p0, Lorg/microemu/android/device/AndroidMutableImage;->bitmap:Landroid/graphics/Bitmap;

    return-object v0
.end method

.method public getData()[I
    .locals 1

    .prologue
    .line 47
    const/4 v0, 0x0

    return-object v0
.end method

.method public getGraphics()Ljavax/microedition/lcdui/Graphics;
    .locals 5

    .prologue
    const/4 v4, 0x0

    .line 52
    new-instance v0, Landroid/graphics/Canvas;

    iget-object v2, p0, Lorg/microemu/android/device/AndroidMutableImage;->bitmap:Landroid/graphics/Bitmap;

    invoke-direct {v0, v2}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 53
    .local v0, canvas:Landroid/graphics/Canvas;
    invoke-virtual {p0}, Lorg/microemu/android/device/AndroidMutableImage;->getWidth()I

    move-result v2

    invoke-virtual {p0}, Lorg/microemu/android/device/AndroidMutableImage;->getHeight()I

    move-result v3

    invoke-virtual {v0, v4, v4, v2, v3}, Landroid/graphics/Canvas;->clipRect(IIII)Z

    .line 54
    new-instance v1, Lorg/microemu/android/device/AndroidDisplayGraphics;

    invoke-direct {v1, v0}, Lorg/microemu/android/device/AndroidDisplayGraphics;-><init>(Landroid/graphics/Canvas;)V

    .line 55
    .local v1, displayGraphics:Lorg/microemu/android/device/AndroidDisplayGraphics;
    invoke-virtual {v1, v4}, Lorg/microemu/android/device/AndroidDisplayGraphics;->setColor(I)V

    .line 56
    invoke-virtual {v1}, Lorg/microemu/android/device/AndroidDisplayGraphics;->getTranslateX()I

    move-result v2

    neg-int v2, v2

    invoke-virtual {v1}, Lorg/microemu/android/device/AndroidDisplayGraphics;->getTranslateY()I

    move-result v3

    neg-int v3, v3

    invoke-virtual {v1, v2, v3}, Lorg/microemu/android/device/AndroidDisplayGraphics;->translate(II)V

    .line 58
    return-object v1
.end method

.method public getHeight()I
    .locals 1

    .prologue
    .line 77
    iget-object v0, p0, Lorg/microemu/android/device/AndroidMutableImage;->bitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v0

    return v0
.end method

.method public getRGB([IIIIIII)V
    .locals 8
    .parameter "argb"
    .parameter "offset"
    .parameter "scanlength"
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v2, 0x1

    .line 84
    if-lez p6, :cond_0

    if-gtz p7, :cond_1

    .line 112
    :cond_0
    :goto_0
    return-void

    .line 86
    :cond_1
    if-ltz p4, :cond_2

    if-ltz p5, :cond_2

    add-int v0, p4, p6

    invoke-virtual {p0}, Lorg/microemu/android/device/AndroidMutableImage;->getWidth()I

    move-result v1

    if-gt v0, v1, :cond_2

    add-int v0, p5, p7

    invoke-virtual {p0}, Lorg/microemu/android/device/AndroidMutableImage;->getHeight()I

    move-result v1

    if-le v0, v1, :cond_3

    .line 87
    :cond_2
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Specified area exceeds bounds of image"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 88
    :cond_3
    if-gez p3, :cond_4

    neg-int v0, p3

    :goto_1
    if-ge v0, p6, :cond_5

    .line 89
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "abs value of scanlength is less than width"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_4
    move v0, p3

    .line 88
    goto :goto_1

    .line 90
    :cond_5
    if-nez p1, :cond_6

    .line 91
    new-instance v0, Ljava/lang/NullPointerException;

    const-string v1, "null rgbData"

    invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 92
    :cond_6
    if-ltz p2, :cond_7

    add-int v0, p2, p6

    array-length v1, p1

    if-le v0, v1, :cond_8

    .line 93
    :cond_7
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 94
    :cond_8
    if-gez p3, :cond_9

    .line 95
    sub-int v0, p7, v2

    mul-int/2addr v0, p3

    add-int/2addr v0, p2

    if-gez v0, :cond_a

    .line 96
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 98
    :cond_9
    sub-int v0, p7, v2

    mul-int/2addr v0, p3

    add-int/2addr v0, p2

    add-int/2addr v0, p6

    array-length v1, p1

    if-le v0, v1, :cond_a

    .line 99
    new-instance v0, Ljava/lang/ArrayIndexOutOfBoundsException;

    invoke-direct {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;-><init>()V

    throw v0

    .line 102
    :cond_a
    iget-object v0, p0, Lorg/microemu/android/device/AndroidMutableImage;->bitmap:Landroid/graphics/Bitmap;

    move-object v1, p1

    move v2, p2

    move v3, p3

    move v4, p4

    move v5, p5

    move v6, p6

    move v7, p7

    invoke-virtual/range {v0 .. v7}, Landroid/graphics/Bitmap;->getPixels([IIIIIII)V

    goto :goto_0
.end method

.method public getWidth()I
    .locals 1

    .prologue
    .line 72
    iget-object v0, p0, Lorg/microemu/android/device/AndroidMutableImage;->bitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    return v0
.end method

.method public isMutable()Z
    .locals 1

    .prologue
    .line 63
    const/4 v0, 0x1

    return v0
.end method
